package cn.jinjimi.app.modules.notify.notifications;

import android.app.PendingIntent;
import android.content.Context;

import cn.jinjimi.app.R;

/**
 * Created by zhenhua on 16/6/6.
 */
public class NotificationBuilder {

    public static final int CODE_DEFAULT = 0;
    public static final int CODE_IM = 1;
    public static final int CODE_CRM = 2;
    public static final int CODE_PHOTO_UPLOAD_STATE = 3;
    public static final int CODE_OTHER = 100;

    public String title;

    public String alert;

    private int icon;

    private final Context context;

    private PendingIntent intent;

    private int code;

    public NotificationBuilder(Context context) {
        this.context = context;

        this.title = context.getResources().getString(R.string.app_name);
        this.icon = R.drawable.logo;
        this.code = CODE_DEFAULT;
    }

    public NotificationBuilder title(int resId) {
        this.title = context.getResources().getString(resId);
        return this;
    }

    public NotificationBuilder alert(int resId) {
        this.alert = context.getResources().getString(resId);
        return this;
    }

    public PendingIntent getPendingIntent() {
        return intent;
    }

    public NotificationBuilder pending(PendingIntent intent) {
        this.intent = intent;
        return this;
    }

    public String getTitle() {
        return title;
    }

    public NotificationBuilder title(String title) {
        this.title = title;
        return this;
    }

    public String getAlert() {
        return alert;
    }

    public NotificationBuilder alert(String alert) {
        this.alert = alert;
        return this;
    }

    public int getIcon() {
        return icon;
    }

    public NotificationBuilder icon(int icon) {
        this.icon = icon;
        return this;
    }

    public int getCode() {
        return code;
    }

    public NotificationBuilder code(int code) {
        this.code = code;
        return this;
    }


}
